<!DOCTYPE html>
<html lang="zh">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimal-ui">
  <title>后台首页 - {$SystemName}</title>
  <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-touch-fullscreen" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="default">
  <link rel="stylesheet" type="text/css" href="/css/materialdesignicons.min.css">
  <link rel="stylesheet" type="text/css" href="/css/bootstrap.min.css">
  <link rel="stylesheet" type="text/css" href="/css/style.min.css">
  <style>
    /* 横幅统计 */
    .card-banner {
      margin-left: 0px;
      margin-right: 0px;
      margin-bottom: 1rem;
      border-radius: var(--border-radius-mini);
      padding: 15px 0px;
      -webkit-box-shadow: 0 0 4px rgba(var(--bs-dark-rgb), 0.075);
      -moz-box-shadow: 0 0 4px rgba(var(--bs-dark-rgb), 0.075);
      box-shadow: 0 0 4px rgba(var(--bs-dark-rgb), 0.075);
    }

    .card-banner [class*=col] .card:before {
      position: absolute;
      height: calc(100%);
      width: 1px;
      background: rgba(77, 82, 89, 0.05);
      content: '';
      right: -15px;
    }

    .card-banner:not(.bg-white) [class*=col] .card:before {
      background: rgba(255, 255, 255, 0.175);
    }

    @media screen and (max-width: 576px) {
      .card-banner [class*=col-] .card:before {
        width: calc(100% - 30px) !important;
        right: 15px !important;
        height: 1px !important;
      }

      .card-banner [class*=col-]:first-child .card:before {
        display: none !important
      }
    }
  </style>
</head>

<body>
  <div class="container-fluid">
    <div class="row card-banner bg-primary">
      <div class="col-sm-6 col-md-6 col-lg-3">
        <div class="card mb-0 bg-transparent shadow-none">
          <div class="card-body text-white">
            <div class="d-flex justify-content-between">
              <span class="avatar-md rounded-circle avatar-box text-white bg-white bg-opacity-25">
                <i class="mdi mdi-server-network fs-4"></i>
              </span>
              <span class="fs-4">{$Usage_count}</span>
            </div>
            <div class="text-end">请求总数</div>
          </div>
        </div>
      </div>
      <div class="col-sm-6 col-md-6 col-lg-3">
        <div class="card mb-0 bg-transparent shadow-none">
          <div class="card-body text-white">
            <div class="d-flex justify-content-between">
              <span class="avatar-md rounded-circle avatar-box text-white bg-white bg-opacity-25">
                <i class="mdi mdi-shield-lock-open fs-4"></i>
              </span>
              <span class="fs-4">{$permission_count}</span>
            </div>
            <div class="text-end">权限总数</div>
          </div>
        </div>
      </div>
      <div class="col-sm-6 col-md-6 col-lg-3">
        <div class="card mb-0 bg-transparent shadow-none">
          <div class="card-body text-white">
            <div class="d-flex justify-content-between">
              <span class="avatar-md rounded-circle avatar-box bg-white bg-opacity-25">
                <i class="mdi mdi-shield-account fs-4"></i>
              </span>
              <span class="fs-4">{$true_count}</span>
            </div>
            <div class="text-end">可用授权</div>
          </div>
        </div>
      </div>
      <div class="col-sm-6 col-md-6 col-lg-3">
        <div class="card mb-0 bg-transparent shadow-none">
          <div class="card-body text-white">
            <div class="d-flex justify-content-between">
              <span class="avatar-md rounded-circle avatar-box text-white bg-white bg-opacity-25">
                <i class="mdi mdi-shield-account-variant fs-4"></i>
              </span>
              <span class="fs-4">{$false_count}</span>
            </div>
            <div class="text-end">过期授权</div>
          </div>
        </div>
      </div>
    </div>

    <div class="row">

      <div class="col-lg-6">
        <div class="card">
          <header class="card-header">
            <div class="card-title">授权总数</div>
          </header>
          <div class="card-body">

            <div class="table-responsive">
              <canvas id="chart-polar" width="360" height="360"></canvas>
            </div>

          </div>
        </div>
      </div>

    </div>

  </div>

  <script type="text/javascript" src="/js/jquery.min.js"></script>
  <script type="text/javascript" src="/js/popper.min.js"></script>
  <script type="text/javascript" src="/js/bootstrap.min.js"></script>
  <script type="text/javascript" src="/js/perfect-scrollbar.min.js"></script>
  <script type="text/javascript" src="/js/main.min.js"></script>
  <script type="text/javascript" src="/js/chart.min.js"></script>
  <script type="text/javascript">
    $(function () {
      new Chart($('#chart-polar'), {
        type: 'polarArea',
        data: {
          labels: [ "过期授权", "可用授权"],
          datasets: [
            {
              label: 'Dataset 1',
              data: [ {$false_count}, {$true_count}],
              backgroundColor: [
                'rgba(108, 117, 125, 0.95)',
                'rgba(0, 123, 255, 0.95)'
              ]
            }
          ]
        },
        options: {
          responsive: true,
          plugins: {
            legend: {
              position: 'top',
            },
          }
        },
      });
    })
  </script>
</body>

</html>